package com.group.admin.controller;

import java.util.Arrays;
import java.util.Map;

import com.group.admin.entity.ShopCommodityEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.group.admin.entity.ShopHeadEntity;
import com.group.admin.service.ShopHeadService;
import com.group.common.utils.PageUtils;
import com.group.common.utils.R;

import javax.servlet.http.HttpSession;


/**
 * 团长管理表
 *
 * @author gxx
 * @email hongyezhaofang.com
 * @date 2021-11-13 10:30:09
 */
@RestController
@RequestMapping("admin/shophead")
public class ShopHeadController {
    @Autowired
    private ShopHeadService shopHeadService;


    /*
    申请团长接口
     */
    @RequestMapping("/applicationleader")
    public R applicationleader(@RequestBody @Validated ShopHeadEntity shopHeadEntity, HttpSession session){
        R applicationleader=shopHeadService.applicationleader(shopHeadEntity,session);
        return R.ok().put("data",applicationleader);
    }

    /*
    查询当前团长信息
     */
    @RequestMapping("/info")
    public R getInfoByheadUserId(HttpSession session){
        ShopHeadEntity byId = shopHeadService.getInfoByheadUserId(session);
        return R.ok().setData(byId);
    }

}
